package thermologic.onewire;

import thermologic.core.DeviceStatus;

/**
 * Status of 1-wire containers
 * 
 * @author Mauricio
 */
public enum DeviceStatusOWC implements DeviceStatus
{
    MISSION_IN_PROGRESS("S001"),
    NO_MISSION("S002"),
    MISSION_WFTA("S003"); //Waiting for temperature alarm
    
    /**
     * Status id for locate the status message
     * in the resource bundle
     */
    private String id;
    
    /**
     * Builds a device status with id
     * 
     * @param id
     */
    private DeviceStatusOWC(String id)
    {
        if(id == null || id.trim().equals(""))
        {
            throw new IllegalArgumentException("id is null or empty.");
        }
        
        this.id = id;
    }
            
    /**
     * @return the status message of 
     * corresponding id
     */
    public String getStatusMessage()
    {
        return Messages.getMessage(id);
    }
}
